<?php
using("Expression_Operator");
/**
 * Binary operators can only have two operands and are placed between them
 *
 * @author Alexander Schearer <aas11@duke.edu>
 */
class Expression_Operator_Binary extends Expression_Operator {
	
	public function __construct($operator, array $expressions) {
		try {
			if (count($expressions) != 2) {
				throw new Exception("Binary operator requires exactly 2 operands");
			}
			parent::__construct($operator, $expressions);
		} catch (Exception $e) {
			throw new Expression_Exception($e);
		}
	}
	
	/**
	 * Add a new operand to the expression to be used when evaluated
	 *
	 * @param Expression_Expression $operand
	 * @return boolean whether the expression was added
	 */
	public function addOperand(Expression_Expression $operand) {
		return false;
	}
}
?>